# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=niaaml-gui
_pkgorig=NiaAML-GUI
pkgver=0.3.0
pkgrel=0
pkgdesc="GUI for NiaAML Python package"
url="https://github.com/firefly-cpp/NiaAML-GUI"
arch="noarch"
license="MIT"
depends="python3 py3-niapy py3-niaaml py3-qtawesome py3-qt6"
checkdepends="py3-pytest"
makedepends="py3-poetry-core py3-gpep517"
subpackages="$pkgname-doc $pkgname-pyc"
source="https://github.com/firefly-cpp/NiaAML-GUI/archive/$pkgver/$_pkgorig-$pkgver.tar.gz"
builddir="$srcdir/NiaAML-GUI-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/niaaml_gui-$pkgver-py3-none-any.whl

	install -Dm644 AppData/io.github.firefly-cpp.niaaml_gui.desktop "$pkgdir"/usr/share/applications/niaaml_gui.desktop
	install -Dm644 AppData/niaaml-gui.png "$pkgdir"/usr/share/icons/hicolor/256x256/apps/niaaml-gui.png

	install -Dm644 CITATION.cff -t "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
7a4fffcea349bdf67beae18eb7b404ba1062dd8cc3bd5a24f882fb683891b1099d2e1dc50cdadb1830cf584e40c16353ce80e450644c20e8c1e65f6b1e8e4e26  NiaAML-GUI-0.3.0.tar.gz
"
